import React from 'react'
import { useState } from 'react'

function Counter(props: any) {
  const [n, setn] = useState(() => {
    return props.count
  })
  console.log('props中的 count', props)
  console.log('n', n)

  return (
    <div>
      <button onClick={() => setn(n + 1)}>{n}</button>
    </div>
  )
}

export function Header() {
  return (
    <>
      <Counter count={10} />
    </>
  )
}
